package cn.yuanqiao.archive.storeRoom.mapper;

import cn.yuanqiao.archive.storeRoom.domain.Box;
import cn.yuanqiao.archive.storeRoom.domain.UpDownShelves;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 盒-格子Mapper接口
 * 
 * @author xy
 * @date 2023-06-26
 */
@Mapper
public interface BoxMapper {
    /**
     * 查询盒-格子
     *
     * @param boxId 盒-格子主键
     * @return 盒-格子
     */
    public Box selectBoxByBoxId(@Param("boxId") Long boxId, @Param("code") String code);

    /**
     * 查询盒-格子列表
     *
     * @param box 盒-格子
     * @return 盒-格子集合
     */
    public List<Box> selectBoxList(Box box);

    /**
     * 新增盒-格子
     *
     * @param box 盒-格子
     * @return 结果
     */
    public int insertBox(Box box);

    /**
     * 修改盒-格子
     *
     * @param box 盒-格子
     * @return 结果
     */
    public int updateBox(Box box);

    /**
     * 删除盒-格子
     *
     * @param boxId 盒-格子主键
     * @return 结果
     */
    public int deleteBoxByBoxId(Long boxId);

    /**
     * 批量删除盒-格子
     *
     * @param boxIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteBoxByBoxIds(Long[] boxIds);

    public Map getMapResult(@Param("categoryId") Long categoryId, @Param("code") String code);

    public Map<String,String> getAjhOrJh(@Param("field") String ajhOrJh, @Param("subtablename") String subtablename, @Param("ids") String ids);

    public ArrayList<String> getDhList(@Param("subtablename") String subtablename, @Param("ids") String ids);

    public String getLastGdz(@Param("categoryId") String id, @Param("dateString") String dateString, @Param("code") String code);

    public Integer getMaxHeHao(@Param("subtablename") String subtablename, @Param("qzh") String qzh, @Param("bgqx") String bgqx, @Param("code") String code);

    public Long getSpecId(@Param("subtablename") String subtablename, @Param("qzh") String qzh, @Param("bgqx") String bgqx, @Param("code") String code);

    public Box getMapResultByHeHao(@Param("hehao") Integer maxHehao, @Param("subtablename") String subtablename, @Param("qzh") String qzh, @Param("bgqx") String bgqx, @Param("code") String code);

    public String getJh(@Param("daIdsStr") String daIdsStr, @Param("subtablename") String subtablename, @Param("code") String code);

    public String getAjh(@Param("daIdsStr") String daIdsStr, @Param("subtablename") String subtablename, @Param("code") String code);

    public int getBoxCount(@Param("boxStNum") Integer box_stnum, @Param("maxHehao") Integer maxHehao, @Param("subtablename") String subtablename, @Param("qzh") String qzh, @Param("bgqx") String bgqx, @Param("categoryId") Long id, @Param("code") String code);

    public Integer getYsByDa(@Param("daId") Long minDaId, @Param("code") String code);

    public Integer getYsByFolder(@Param("daId") Long minDaId, @Param("code") String code);

    public int getYsByDas(@Param("daId") String daIdsStr, @Param("code") String code);

    public int getYsByFolders(@Param("daId") String daIdsStr, @Param("code") String code);

    public int getPageInHeByDa(@Param("ids")String ids, @Param("code") String code);

    public int getPageInHeByFolders(@Param("ids")String ids, @Param("code") String code);

    public Long getBoxId(@Param("hehao") Long hehao, @Param("subTableName") String subTableName, @Param("qzh") String qzh, @Param("bgqx")String bgqx, @Param("code") String code);
/*

    public String getFolderId(@Param("subTableName") String subTableName, @Param("itemNoOrAjh") String itemNoOrAjh, @Param("archivalCode") String dhSubString);

    public String getDaId(@Param("subTableName") String subTableName, @Param("itemNoOrAjh") String itemNoOrAjh, @Param("archivalCode") String dhSubString);
*/

    public Integer getDaTotalYsByFolder(@Param("ids") String ids, @Param("boxStNum") int box_stnum, @Param("boxEdNum") int box_ednum, @Param("code") String code, @Param("subTableName") String subTableName);

    public Integer getDaTotalYsByDa(@Param("ids") String ids, @Param("boxStNum") int box_stnum, @Param("boxEdNum") int box_ednum, @Param("code") String code, @Param("subTableName") String subTableName);

    public List<Box> getDaBoxList(@Param("qzh")String qzh, @Param("bgqx")String bgqx, @Param("subTableName") String subTableName, @Param("code") String code);

    public String getPutawayStatus(@Param("ids") String ids, @Param("categoryId") Long categoryId, @Param("code") String code);

    public List<Map<String, Object>> getDhMessageList(@Param("ajhOrJh") String ajhOrJh, @Param("subtablename") String subtablename, @Param("ids") String ids);

    public ArrayList<String> getBoxIdByDaId(@Param("daId") String id, @Param("subtablename") String subtablename, @Param("code") String code);

    public ArrayList<String> getDaIdList(@Param("subtablename") String subtablename, @Param("boxId") Long boxId, @Param("paixu") String paixu, @Param("code") String code);

    public Map<String, Object> getBoxMapByBoxId(@Param("boxId") Long boxId, @Param("code") String code);

    public String getIds(@Param("subtablename") String subtablename, @Param("qzh")String qzh, @Param("bgqx")String bgqx, @Param("ids") String ids, @Param("ajhOrJh") String ajhOrJh, @Param("boxEdnum") int box_ednum, @Param("single3")String single3);

    public String getIdMessage(@Param("subtablename") String subtablename, @Param("qzh")String qzh, @Param("bgqx")String bgqx, @Param("ajhOrJh") String ajhOrJh, @Param("boxEdnum") int box_ednum, @Param("single3")String single3);

    public int getSumYsByFolder(@Param("jnjTableName") String jnjTableName, @Param("subtablename") String subtablename, @Param("boxId") Long boxId, @Param("oldBoxStnum") Integer oldBoxStnum, @Param("boxStnum")Integer boxStnum, @Param("code")String code);

    public int getSumYsByDa(@Param("subtablename") String subtablename, @Param("boxId") Long boxId, @Param("code") String code, @Param("oldBoxStnum") Integer oldBoxStnum, @Param("boxStnum")Integer boxStnum);

    public String getIdss(@Param("subtablename") String subtablename, @Param("boxId") Long boxId, @Param("code") String code, @Param("ajhOrJh") String ajhOrJh, @Param("oldBoxStnum") Integer oldBoxStnum, @Param("boxStnum")Integer boxStnum);

    public int getSumYsByBoxEndNum(@Param("jnjTableName") String jnjTableName, @Param("subtablename") String subtablename, @Param("boxId")Long boxId, @Param("oldBoxEdnum") Integer oldBoxEdnum, @Param("boxEdnum") Integer boxEdnum, @Param("code")String code);

    public int getSumDaYsByBoxEndNum(@Param("subtablename")String subtablename, @Param("boxId") Long boxId, @Param("code") String code, @Param("oldBoxEdnum") Integer oldBoxEdnum, @Param("boxEdnum") Integer boxEdnum);

    public String getIdssByBoxEdNum(@Param("subtablename")String subtablename, @Param("boxId") Long boxId, @Param("code") String code, @Param("ajhOrJh") String ajhOrJh, @Param("oldBoxEdnum") Integer oldBoxEdnum, @Param("boxEdnum") Integer boxEdnum);

    public List<UpDownShelves> getBoxList(@Param("code") String code, @Param("gzId") Long gzId, @Param("keyword")String keyword);

    public List<UpDownShelves> getBoxListByfolderId(@Param("code") String code, @Param("gzId") Long gridId, @Param("keyword")String keyword);

    public List<UpDownShelves> getSjBoxList(@Param("code")String code, @Param("keyword")String keyword);

    public List<UpDownShelves> getSjBoxListByfolderId(@Param("code")String code, @Param("keyword")String keyword);

    public List<Map<String, Object>> getRkBoxList(@Param("code") String code);

    public List<Map<String, Object>> getRkBoxListByfolderId(@Param("code") String code);

    public List<Map<String, Object>> getDaList(@Param("subtableName") String subtableName, @Param("code") String code, @Param("boxId") Long boxId);

    public int getUpShelvesNum(@Param("gzId") Long grid_id, @Param("code") String code);

    public String getUpShelvesNumByFolderId(@Param("gridId") Long gridId, @Param("code") String code);

    public  List<Box> printRidgeBox(@Param("ids")String ids, @Param("tableName") String tableName);

    public List<Map<String, Object>> getDaListByIds(@Param("subtablename") String subtablename, @Param("ids") String ids);

    public Map<String, String> getDaNd(@Param("subTableName")String subTableName, @Param("boxId") Long boxId, @Param("code") String code);

    public int getPageHeByDa(@Param("boxId") Long boxId, @Param("code") String code);

    public int getPageHeByFolders(@Param("boxId")Long boxId, @Param("code")  String toUpperCase);

  public  Map<String, String> getDaNdByIds(@Param("subTableName")String subTableName, @Param("ids")String daIdsStr);

    int getCount(@Param("daIds") String daIds, @Param("code") String code);

    String getSyIds(@Param("boxId") String boxId, @Param("ids") String idss, @Param("code")String code);
    List<UpDownShelves> selectList(@Param("bgqx") String bgqx,@Param("hehao") Integer hehao,@Param("categoryId")Long  categoryId,@Param("code")String code);

}
